package com.zifan.sever.utils;

import com.zifan.sever.bean.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 操作员工具了类
 * @author Zifan
 * @date 2021年05月02日22:22
 */
public class AdminUtil {
    /**
     * 获取当前登录的admin用户
     * @return
     */
    public static Admin getCurrent(){
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
